﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GMAC.ReportingSystem.Business.Entities.Others
{
    public delegate void PropertyChangeHandler(object sender);

    //------------------------------------------------------------------------------
    /// <summary>
    /// Ricardo Recaredo (17/12/2010)
    /// 
    /// Clase Wraper con una propuiedad genérica que dispara evento cuando se modifica
    /// la propiedad envuelta.
    /// </summary>
    //------------------------------------------------------------------------------

    public class DynamicProperty<T>
    {
        private T _val;

        public T val
        {
            get 
            {
                return _val;
            }
            set
            {
                _val = value;

                if (PropertyChange != null)
                {
                    PropertyChange(this);
                }
            }
        }

        public event PropertyChangeHandler PropertyChange;

        public DynamicProperty()
        {
        }
    }
}
